<template>
  <div class="wrapper">
    <swiper :options="swiperOption" >
      <!-- slides -->
      <swiper-slide v-for="item of swiperList" :key="item.id">
        <img class="swiper-img" :src="item.imgUrl" alt="">
      </swiper-slide>
      <!-- Optional controls -->
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination', // 分页标识
        loop: true // 循环轮播
      },
      swiperList: [
        {
          id: 1001,
          imgUrl: 'http://img1.qunarzz.com/piao/fusion/1808/66/55bc874f100c2d02.jpg_750x200_ac7c05d2.jpg'
        }, {
          id: 1002,
          imgUrl: 'http://img1.qunarzz.com/piao/fusion/1805/e5/59fad13a64807d02.jpg_750x200_713ae984.jpg'
        }, {
          id: 1003,
          imgUrl: 'http://img1.qunarzz.com/piao/fusion/1806/ae/2f9a9f0bbc30e102.jpg_750x200_75b6a866.jpg'
        }
      ]
    }
  }
}
</script>

<style lang="stylus" type="text/stylus"  scoped>
  .wrapper >>> .swiper-pagination-bullet-active
      background :#ffffff
  .wrapper
    overflow :hidden
    width: 100%
    height: 0
    padding-bottom :26.5%
    background :#f5f5f5
    .swiper-img
      width: 100%
</style>
